﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace BookManage.Model
{
    /// <summary>
    /// 实体类Borrow
    /// </summary>
    public class Borrow
    {
        public Borrow() { }
        #region 公有属性
        public int BorrowID { get; set; }
        public int rdID { get; set; }
        public int bkID { get; set; }
        public int IdContinueTimes { get; set; }
        public DateTime IdDateOut { get; set; }
        public DateTime IdDateRetPlan { get; set; }
        public DateTime IdDateRetAct { get; set; }
        public int IdOverDay { get; set; }
        public float IdOverMoney { get; set; }
        public float IdPunishMoney { get; set; }
        public bool IsHasReturn { get; set; }
        public string OperatorLend { get; set; }
        public string OperatorRet { get; set; }

        public static string ColumnTitle(string columnName)
        {
            string[,] ColumnsTitle =
            {
                { "BorrowID","借书序号"}, { "rdID","借书证号"},{"bkID","书号"}, { "bkName","书名"}, {"bkAuthor","图书作者" }, {"IdContinueTimes","续借次数"},
                {"IdDateOut","借书日期" }, {"IdDateRetPlan","应还日期"}, {"IdOverDay","超期天数"}, {"IdDateRetAct","实际还书日期"},
                {"IdOverMoney","应罚款金额"}, {"IsHasReturn","是否还书"}, {"OperatorLend","借书操作员"},{"OperatorRet","还书操作员" }
            };
            for (int i = 0; i < ColumnsTitle.Length / 2; i++)
            {
                if (columnName == ColumnsTitle[i, 0])
                    return ColumnsTitle[i, 1];
            }
            return columnName;
        }
    }
    #endregion
}